#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

class A
{
public:

	A(int x, int y)
		:_x(x)
		,_y(y)
	{
	}

	A(int x)
		:_x(x)
		,_y(x)
	{
	}

	void Get()
	{
		cout << "x = " << _x  << " y = " << _y << endl;
	}

private:
	int _x = 0;
	int _y = 0;
};

int main1()
{

	A a = 1;
	A b = { 1,2 };

	a.Get();
	b.Get();

	const A& a1 = { 1,2 };

	initializer_list<int> v1 = { 1,2,3,4,5,6,7,8,9 };
	for (auto e : v1)
	{
		cout << e << " ";
	}
	
	return 0;
}



int main2()
{
	int a = 1, b = 2;
	auto swap = [&a, &b]() {
		int tmp = a;
		a = b;
		b = tmp;
	};

	swap();

	cout << a << " " << b;

	return 0;
}


#include <functional>

int f(int a, int b)
{
	return a + b;
}

struct Functor
{
public:
	int operator()(int a, int b)
	{
		return a + b;
	}
};

